home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
texts
/
hsc.lha
/
hsc
/
src_docs
/
features
/
if.hsc
< prev
next >
Wrap
Text File
|
1996-03-31
|
1KB
|
48 lines
<WEBPAGE chapter="hsc - Features - " title="Conditional conversion"
PREV=":macro/macros.html"
NEXT=":macro/macros.html">
<H2>Syntax</H2>
Conditional conversion looks like that:
<PRE>
<CODE><$IF</CODE> <I><A HREF="expressions.html">expression</A></I><CODE>></CODE>
<I>...if part...</I>
[
<CODE><$ELSE></CODE>
<I>...optional else part...</I>
]
<CODE></$IF></CODE>
</PRE>
<H2>Example</H2>
<P>A good example for the usage of conditional conversion inside a macro is
the <TG>WEBPAGE</TG> macro used to create the documentation for <hsc>.</P>
<P>It also shows how to create a navigation bar with optional references to
a next and previous page.</P>
<PRE>
<$include file="inc/webpage.hsc" SOURCE>
</PRE>
<H2>Notes</H2>
<P><TG>$IF ..</TG> is nestable.</P>
<P>You can't compare <hsc>'s <TG>$IF ..</TG> to <CODE>#if</CODE>
of the C-preprocessor. The main difference is that you can use <TG>$IF ..</TG>
inside macros and that expressions are recalculated for every new
call of the macro.</P>
</WEBPAGE>